package cn.edu.gzmtu.dao;

import cn.edu.gzmtu.domain.SysLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 系统日志dao层
 */
@Repository
public interface ISysLogDao {

    /**
     * 添加日志
     * @param sysLog
     */
    @Insert("insert into syslog(visitTime, username, ip, url, executionTime, method)values(#{visitTime}, #{username}, #{ip}, #{url}, #{executionTime}, #{method})")
    void save(SysLog sysLog) throws Exception;

    /**
     * 查询所有
     * @return
     */
    @Select("select * from sysLog")
    List<SysLog> findAll() throws Exception;
}
